package com.cty;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

/*
*
*  运用properties对象将键值对写入properties对象中
* */
public class properties02 {
    public static void main(String[] args) throws IOException {
        Properties properties = new Properties();
        properties.setProperty("admin","123456");
        properties.setProperty("Chinese","wo");
        properties.setProperty("shuaige","shiwo");
        //写入properties文件用store这个方法
        properties.store(new FileWriter("src/users02.properties"),"These are many users");
        System.out.println("保存成功");
    }
}
